package com.zhaoxi.project.fms.service.impl;

import java.util.List;
import com.zhaoxi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhaoxi.project.fms.mapper.FmsBillMapper;
import com.zhaoxi.project.fms.domain.FmsBill;

/**
 * 财务单据Service业务层处理
 * 
 * @author zhaoxi
 * @date 2023-08-14
 */
@Service
public class FmsBillServiceImpl
{
    @Autowired
    private FmsBillMapper fmsBillMapper;

    /**
     * 查询财务单据
     * 
     * @param id 财务单据主键
     * @return 财务单据
     */
    
    public FmsBill selectFmsBillById(Long id)
    {
        return fmsBillMapper.selectFmsBillById(id);
    }

    /**
     * 查询财务单据列表
     * 
     * @param fmsBill 财务单据
     * @return 财务单据
     */
    
    public List<FmsBill> selectFmsBillList(FmsBill fmsBill)
    {
        return fmsBillMapper.selectFmsBillList(fmsBill);
    }

    /**
     * 新增财务单据
     * 
     * @param fmsBill 财务单据
     * @return 结果
     */
    
    public int insertFmsBill(FmsBill fmsBill)
    {
        fmsBill.setCreateTime(DateUtils.getNowDate());
        return fmsBillMapper.insertFmsBill(fmsBill);
    }

    /**
     * 修改财务单据
     * 
     * @param fmsBill 财务单据
     * @return 结果
     */
    
    public int updateFmsBill(FmsBill fmsBill)
    {
        fmsBill.setUpdateTime(DateUtils.getNowDate());
        return fmsBillMapper.updateFmsBill(fmsBill);
    }

    /**
     * 批量删除财务单据
     * 
     * @param ids 需要删除的财务单据主键
     * @return 结果
     */
    
    public int deleteFmsBillByIds(Long[] ids)
    {
        return fmsBillMapper.deleteFmsBillByIds(ids);
    }

    /**
     * 删除财务单据信息
     * 
     * @param id 财务单据主键
     * @return 结果
     */
    
    public int deleteFmsBillById(Long id)
    {
        return fmsBillMapper.deleteFmsBillById(id);
    }
}
